package com.mall.server.interceptor;

import com.mall.model.domain.UmsAdmin;

/**
 * @author : xyiaao
 * @createDate : 2022/3/16 20:08
 */
public class UserHolder {

    private static ThreadLocal<UmsAdmin> threadLocal = new ThreadLocal<>();

    public static void set(UmsAdmin umsAdmin) {

        threadLocal.set(umsAdmin);
    }

    public static UmsAdmin get() {

        return threadLocal.get();
    }

    public static Long getId() {

        return threadLocal.get().getId();
    }

    public static void remove() {

        threadLocal.remove();
    }

}
